<template>
  <WangEditor v-model="valueHtml" @upload="upload" />
  {{ valueHtml }}
</template>
<script setup lang="ts">
import { ref } from 'vue'
import WangEditor from './wang-editor.vue';
import { AFile } from '@/api';

const valueHtml = ref('123')

function upload(file: File, done: (url: string) => void) {
  const formData = new FormData()
  formData.append('file', file)
  AFile.upload(formData).then(res => {
    done(res.data)
  })
}
</script>

<style lang="scss" scoped></style>
